
APXS=apxs2
PREFIX=
LIB=/usr/lib
JSINC=/usr/include/mozjs
JSLIB=mozjs
JSPLAT=XP_UNIX

src/mod_javascript.la: src/mod_javascript.c include/mod_javascript.h
	${APXS} -I$(JSINC) -L$(LIB) -l$(JSLIB) -D$(JSPLAT) -c src/mod_javascript.c

src/mod_javascript.c: include/mod_javascript.h

clean:
	-rm -rf src/mod_javascript.o src/mod_javascript.lo src/mod_javascript.slo src/mod_javascript.la src/.libs

testing/apache/modules/mod_javascript.so: src/mod_javascript.la
	make install APXS=testing/apache/bin/apxs

test: testing/apache/modules/mod_javascript.so
	prove `perl -e 'print "$(VERBOSE)" && "-v"'` `perl -e 'print "$(TEST)" || "-r"'`

install: src/mod_javascript.la
	${APXS} -i src/mod_javascript.la

deb: src/mod_javascript.la
	/usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1.0/build/libtool' src/mod_javascript.la $(PREFIX)/usr/lib/apache2/modules

debclean:
	make -f debian/rules clean
